// JavaScript Document

// fade
$("img").css("visibility", "hidden").imagesLoaded({
	progress: function(isBroken, $images, $proper, $broken) {
		var $this = $(this).css("visibility", "");
		if($.support.opacity) $this.css("opacity", 0).animate({"opacity": 1}, function() { $this.css({"opacity": ""}); if(!$this.attr("style")) $this.removeAttr("style"); });
	}
});

// inputs
$("select, input, a.button, button").uniform();
$("label").inFieldLabels();

// menu
$("#menu > li").on({
	mouseenter: function() {
		if(!$("#doc:focus").length) $(this).children("div.dropdown").stop().hide().slideDown();
	},
	mouseleave: function() {
		if(!$("#doc:focus").length) $(this).children("div.dropdown").stop().attr("style", "");
	}
});

// link
$("#section").on({
	mouseenter: function() {
		$(this).find("img").css({"visibility": "visible", "opacity": 0}).stop(true).animate({"opacity": 1});
	},
	mouseleave: function() {
		$(this).find("img").stop(true).animate({"opacity": 0}, "medium", function() { $(this).attr("style", ""); });
	}
}, "div.link");

// slideshow
$("ul.slidetabs").tabs("div.slide", {
	effect:"fade",
	fadeOutSpeed:1000,
	fadeInSpeed:1000,
	rotate:true
}).slideshow({autoplay:true, autopause:false, interval:6000, clickable:false});

// scrollbar
$("#main").find("div.wrapper2").mCustomScrollbar({
	scrollButtons:{enable:true},
	advanced:{updateOnContentResize:true},
	theme:"dark-2"
});

$("#main").find("div.wrapper").mCustomScrollbar({
	scrollButtons:{enable:true},
	advanced:{updateOnContentResize:true},
	theme:"dark-2"
});


//overlay
 $("span[rel]").overlay({
	  
	  mask: {
        color: '#333',
        loadSpeed: 200,
        opacity: 0.9
      },
 
      closeOnClick: true,
	  effect: 'apple'
 
 });

function abreventana(donde,quien,como)
{ 
infoventana=window.open(donde,quien,como);
if (navigator.appName.substring(0,8) == "Netscape")	
{
window.infoventana.focus()
}
}
function enlaza_vf(donde)
{
window.open(donde,'','toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=700,height=450,top=16,left=50');
}

function enlaza_vf1(donde)
{
window.open(donde,'','toolbar=no,status=no,scrollbars=no,resizable=no,width=410,height=253,top=16,left=50');
}

function enlaza(donde)
{
document.location=donde;
}
function enlaza_memoria(donde)
{
window.open(donde,'','toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=700,height=465,top=16,left=50');
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function enlazapromo(donde)
{
window.open(donde,'','height=244,width=778,menubar=no,resizable=no,status=no,scrollbars=no,toolbar=no,location=no,hotkeys=0,top=16,left=16');
}
function ampliar(donde)
{
window.open(donde,'','height=252,width=318,menubar=no,resizable=no,status=no,scrollbars=no,toolbar=no,location=no,hotkeys=0,top=16,left=16');
}
function CambiaData(pagina)
{
	if (pagina!="0")
	{
	window.location.href=pagina;
	}
}